const isDEV = process.env.NODE_ENV === "development"; // 是否是开发模式
module.exports = {
  presets: [
    [
      "@babel/preset-env",
      {
        targets: {
          browsers: ["> 1%", "last 2 versions", "not ie <= 8"]
        },
        useBuiltIns: "usage",
        corejs: 3, // 配置使用core-js使用的版本
        loose: true,
      },
    ],
    ["@babel/preset-react", { runtime: "automatic" }],
    "@babel/preset-typescript",
  ],
  plugins: [
    ["@babel/plugin-proposal-decorators", { legacy: true }],
  ].filter(Boolean), // 过滤空值
}